package com.api.shopapi.service.impl;

import com.api.shopapi.entity.GoodsSizeRemark;
import com.api.shopapi.mapper.GoodsSizeRemarkMapper;
import com.api.shopapi.service.GoodsSizeRemarkService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("GoodsSizeRemarkServiceImplOne")
public class GoodsSizeRemarkServiceImpl implements GoodsSizeRemarkService {

    @Autowired
    private GoodsSizeRemarkMapper goodsSizeRemarkMapper;

    @Override
    public int insert(GoodsSizeRemark goodsSizeRemark) {
        return goodsSizeRemarkMapper.insert(goodsSizeRemark);
    }

    @Override
    public int update(GoodsSizeRemark goodsSizeRemark) {
        return goodsSizeRemarkMapper.update(goodsSizeRemark);
    }

    @Override
    public int delete(String goodsSizeRemarkCode) {
        return goodsSizeRemarkMapper.delete(goodsSizeRemarkCode);
    }

    @Override
    public GoodsSizeRemark getByGoodsSizeRemarkCode(String goodsSizeRemarkCode) {
        return goodsSizeRemarkMapper.getByGoodsSizeRemarkCode(goodsSizeRemarkCode);
    }

    @Override
    public List<GoodsSizeRemark> getList(String businessCode) {
        return goodsSizeRemarkMapper.getList(businessCode);
    }

    @Override
    public PageInfo<GoodsSizeRemark> getPageList(int pageIndex,int pageSize,String name, String businessCode) {
        PageHelper.startPage(pageIndex,pageSize);
        List<GoodsSizeRemark> goodsSizeRemarkList = goodsSizeRemarkMapper.getPageList(name, businessCode);
        PageInfo<GoodsSizeRemark> goodsSizeRemarkPageInfo=new PageInfo<>(goodsSizeRemarkList);
        return goodsSizeRemarkPageInfo;
    }
}
